<?php

use backend\models\EduIncome;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\EduIncomeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Edu Incomes';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="edu-income-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Edu Income', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
//            'user.nickname',
            [
                'label' => '被奖励的用户ID',
                'attribute' => 'user.nickname',
            ],
            'title',
            [
                'label' => '奖励来源ID',
                'attribute' => 'users.nickname',
            ],
//            'obj_id',
//            'users.nickname',
//            'style',
            [
                'attribute' => 'style',
                'enableSorting' => false,
                'value' => 'styleValue',
                'filter' => EduIncome::attributeValue()['style']
            ],
            //'source',
            //'create_time:datetime',
            //'status',
            'amount',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
